<template>
	<view class="content">
		<text class="home-title__item">强国答题大全</text>
		<image class="home-title-2__item" src="../../static/home_title_2.png" mode=""></image>
		<image class="home-search__item" @click="srarchBtnClickHandeler" src="../../static/home_serch.png" mode=""></image>
		<view class="home-btn__group">
			<view class="home-btn__item" @click="jumpToOhter('wxb036cafe2994d7d0')">圈子</view>
			<navigator url="/pages/news/news" class="home-btn__item">新闻</navigator>
			<view class="home-btn__item" @click="jumpToPage(1)">每周</view>
			<view class="home-btn__item" @click="jumpToPage(2)">专项</view>
			<!-- <navigator open-type="switchTab" url="/pages/tiku/tiku?page=1" class="home-btn__item">每周</navigator> -->
			<!-- <navigator open-type="switchTab" url="/pages/tiku/tiku?page=2" class="home-btn__item">专项</navigator> -->
		</view>
		<image class="home-talk__item" @touchstart="srarchBtnClickHandeler2" src="../../static/home-talk.png" mode=""></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {

		},
		methods: {
			jumpToPage(page) {
				getApp().tikuPage = page;
				uni.switchTab({
					url:'/pages/tiku/tiku'
				})
			},
			jumpToOhter(appId) {
				console.log('跳转小程序')
				uni.navigateToMiniProgram({
					appId,
					fail: (err) => {
						console.log(err)
					}
				})
			},
			srarchBtnClickHandeler() {
				uni.navigateTo({
					url: "../search/search"
				})
			},
			srarchBtnClickHandeler2() {
				uni.navigateTo({
					url: "../search/search?miva=true"
				})
			}
		}
	}
</script>

<style lang="scss">
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}

	.home-title__item {
		font-size: 90rpx;
		font-weight: bold;
		color: $miva-color-base;
	}

	.home-title-2__item {
		width: 60vw;
		height: calc(60vw / (294 / 41));
		margin: auto;
	}

	.home-search__item {
		width: 80vw;
		height: calc(80vw / (457 / 96));
		margin: 10px auto;
	}

	.home-btn__group {
		width: 90vw;
		height: calc(90vw / (1000 / 183));
		background-image: url(https://miva-unmcc.oss-cn-beijing.aliyuncs.com/home-btn__group.png);
		background-size: cover;
		display: flex;
		padding: 0 20px;
		box-sizing: border-box;
	}

	.home-talk__item {
		width: 50vw;
		height: calc(50vw / (232 / 218));
		margin: 50px auto 0;
	}

	.home-btn__item {
		width: 25%;
		height: 100%;
		text-align: center;
		font-size: 12px;
		position: relative;
		padding-top: 15%;
		color: #aaa;
		box-sizing: border-box;
	}
</style>
